package engine.core
{
	public class RxDate
	{
		private static var s_date:Date = new Date(0);
		
		public function RxDate()
		{
			throw new ArgumentError();
		}
		
		public static function Now() : Number
		{
			return new Date().time;
		}
		
		public static function toString(param1:Number) : String
		{
			s_date.setTime(param1);
			return s_date.toString();
		}
		
		public static function IsValid(param1:Number) : Boolean
		{
			return !isNaN(param1);
		}
		
		public static function IsAAfterB(param1:Number, param2:Number) : Boolean
		{
			return param1 > param2;
		}
		
		public static function IsABeforeB(param1:Number, param2:Number) : Boolean
		{
			return param1 < param2;
		}
		
		public static function GetDateString(param1:Number, param2:Number) : String
		{
			var _loc_3:int = 0;
			if (IsValid(param1))
			{
				_loc_3 = GetSecondsFromAUntilB(param2, param1);
				return ConvertSecondsToString(_loc_3);
			}
			return "";
		}
		
		public static function ConvertSecondsToString(param1:int) : String
		{
			var _loc_2:int = 0;
			var _loc_3:int = 0;
			var _loc_4:int = 0;
			var _loc_5:int = 0;
			_loc_2 = param1 % 60;
			param1 = param1 / 60;
			_loc_3 = param1 % 60;
			param1 = param1 / 60;
			_loc_4 = param1 % 24;
			param1 = param1 / 24;
			_loc_5 = param1;
			var _loc_6:* = GetDoubleDigitFormat(_loc_2);
			var _loc_7:* = GetDoubleDigitFormat(_loc_3);
			var _loc_8:* = GetDoubleDigitFormat(_loc_4);
			var _loc_9:* = GetDoubleDigitFormat(_loc_4) + ":" + _loc_7 + ":" + _loc_6;
			return GetDoubleDigitFormat(_loc_4) + ":" + _loc_7 + ":" + _loc_6;
		}
		
		private static function GetDoubleDigitFormat(param1:uint) : String
		{
			if (param1 < 10)
			{
				return "0" + param1;
			}
			return String(param1);
		}
		
		public static function GetSecondsFromAUntilB(param1:Number, param2:Number) : int
		{
			return int((param2 - param1) / 1000);
		}
	}
}